package db.dto;

import java.io.Serializable;

public class DoctorDto extends PersonDto implements Serializable
{
	/**
	 * This attribute maps to the column ID_DEPARTMENT in the DOCTOR table.
	 */
	protected int idDepartment;

	/** 
	 * This attribute maps to the column SPECIALITY in the DOCTOR table.
	 */
	protected String speciality;

	/** 
	 * This attribute maps to the column EXP in the DOCTOR table.
	 */
	protected int exp;

	/** 
	 * This attribute represents whether the primitive attribute exp is null.
	 */
	protected boolean expNull = true;

	/**
	 * Method 'DoctorDto'
	 * 
	 */

    public DoctorDto(PersonDto dto) {
        super();
        super.setIdPerson(dto.getIdPerson());
        super.setLogin(dto.getLogin());
        super.setName(dto.getName());
        super.setPassword(dto.getPassword());
    }

    public int getId() {
        return this.idPerson;
    }

    /**
	 * Method 'getIdDoctor'
	 * 
	 * @return int
	 */

	public int getIdDoctor()
	{
		return this.idPerson;
	}

	/**
	 * Method 'setIdDoctor'
	 * 
	 * @param idDoctor
	 */
	public void setIdDoctor(int idDoctor)
	{
		this.idPerson = idDoctor;
	}

	/**
	 * Method 'getIdDepartment'
	 * 
	 * @return int
	 */
	public int getIdDepartment()
	{
		return idDepartment;
	}

	/**
	 * Method 'setIdDepartment'
	 * 
	 * @param idDepartment
	 */
	public void setIdDepartment(int idDepartment)
	{
		this.idDepartment = idDepartment;
	}

	/**
	 * Method 'getSpeciality'
	 * 
	 * @return String
	 */
	public String getSpeciality()
	{
		return speciality;
	}

	/**
	 * Method 'setSpeciality'
	 * 
	 * @param speciality
	 */
	public void setSpeciality(String speciality)
	{
		this.speciality = speciality;
	}

	/**
	 * Method 'getExp'
	 * 
	 * @return int
	 */
	public int getExp()
	{
		return exp;
	}

	/**
	 * Method 'setExp'
	 * 
	 * @param exp
	 */
	public void setExp(int exp)
	{
		this.exp = exp;
		this.expNull = false;
	}

	/**
	 * Method 'setExpNull'
	 * 
	 * @param value
	 */
	public void setExpNull(boolean value)
	{
		this.expNull = value;
	}

	/**
	 * Method 'isExpNull'
	 * 
	 * @return boolean
	 */
	public boolean isExpNull()
	{
		return expNull;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof DoctorDto)) {
			return false;
		}
		
		final DoctorDto _cast = (DoctorDto) _other;
		if (this.idPerson != _cast.idPerson) {
			return false;
		}
		
		if (idDepartment != _cast.idDepartment) {
			return false;
		}
		
		if (speciality == null ? _cast.speciality != speciality : !speciality.equals( _cast.speciality )) {
			return false;
		}
		
		if (exp != _cast.exp) {
			return false;
		}
		
		if (expNull != _cast.expNull) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + idPerson;
		_hashCode = 29 * _hashCode + idDepartment;
		if (speciality != null) {
			_hashCode = 29 * _hashCode + speciality.hashCode();
		}
		
		_hashCode = 29 * _hashCode + exp;
		_hashCode = 29 * _hashCode + (expNull ? 1 : 0);
		return _hashCode;
	}

    /**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "db.dto.DoctorDto: " );
		ret.append( "idDoctor=" + idPerson );
		ret.append( ", idDepartment=" + idDepartment );
		ret.append( ", speciality=" + speciality );
		ret.append( ", exp=" + exp );
		return ret.toString();
	}

}
